package com.xinke.juc.case04;

import com.xinke.juc.util.Sleeper;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.locks.LockSupport;

/**
 * @Author：xinke
 * @Date：2025/10/3
 * @Desc:
 */
@Slf4j
public class ParkUnpark {
    public static void main(String[] args) {
        Thread t1 = new Thread(() -> {
            log.info("start。。。");
            Sleeper.sleep(1);
            log.info("park。。。");
            LockSupport.park();
            log.info("resume。。。");
        }, "t1");
        t1.start();
        Sleeper.sleep(2);
        log.info("unpark。。。");
        LockSupport.unpark(t1);
    }
}
